package cn.edu.hubu.hubusmartmedicalsystem.controller;


import cn.edu.hubu.hubusmartmedicalsystem.entity.Registe;
import cn.edu.hubu.hubusmartmedicalsystem.service.RegisteService;
import cn.edu.hubu.hubusmartmedicalsystem.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class RegisteController {
    @Autowired
    private RegisteService registeService;


    @RequestMapping("/user/insertregiste")
    public ResultVO insertregiste(Registe registe){
        return registeService.addregiste(registe);
    }
    @RequestMapping("/admin/updateregiste")
    public  ResultVO updateregiste(Registe registe) {
        return registeService.updateregiste(registe);
    }
    @RequestMapping("/admin/getregistebyId")
    public ResultVO getregistebyId(String Id){
        return registeService.getregistebyId(Id);

    }
    @RequestMapping("/admin/getregistByPatientId")
    public ResultVO getregistByPatientId(String patientId){
        return registeService.getregisteByPatientId(patientId);
    }
    @RequestMapping("/admin/getregistAll")
    public  ResultVO getregistAll(){
        return registeService.getregistall();
    }
}
